//
//  BACollectionViewCell.m
//  HappyBaby
//
//  Created by lanou on 15/11/24.
//  Copyright © 2015年 华哥. All rights reserved.
//

#import "BACollectionViewCell.h"
#import "Define.h"
#import "UIImageView+WebCache.h"
@interface BACollectionViewCell ()
@property(nonatomic,retain)UIImageView *iconImageView;
@property(nonatomic,retain)UILabel *textLabel;
@end
@implementation BACollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if ( self)
    {
        CGFloat width = (kScreenWidth-15)/2;
        CGFloat height = 340 * width/680;
        self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, width, height)];
        //self.iconImageView.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:self.iconImageView];
        
        self.textLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, height, width, 15)];
        //self.textLabel.backgroundColor = [UIColor magentaColor];
        self.textLabel.textColor = [UIColor blackColor];
        self.textLabel.font = [UIFont boldSystemFontOfSize:14];
        [self.contentView addSubview:self.textLabel];
    }
    
    return self;
    
    
}
- (void)setModel:(ThreeModel *)model
{
    _model = model;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil];
    self.textLabel.text = model.title;
}


@end
